<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet"/>
    <link th:href="@{/css/index.css}" rel="stylesheet"/>
    <link th:href="@{/css/tool.css}" rel="stylesheet"/>
    <link th:href="@{/css/show.css}" rel="stylesheet"/>
    <link th:href="@{/css/easyeditor.css}" rel="stylesheet"/>

    <!-- 图标  -->
    <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_1531710_xb357ub1wmg.css"/>
    <script th:src="@{/layui/layui.js}" type="application/javascript"></script>
    <script th:src="@{/js/marked.min.js}" type="application/javascript"></script>
</head>
<body>
<div th:fragment="show">
    <div class="nav-1">
        <div class="nav-2">
            <div class="status fl">
                <span id="kbTag">待开标</span>
            </div>
            <div class="kaibiao fl">
            <span class="span1">
                <input type="hidden" id="openTime" th:value="${#dates.format(zbInfo.openTime,'yyyy-MM-dd HH:mm:ss')}">
                开标时间：
                <span th:text="${#dates.format(zbInfo.openTime,'yyyy-MM-dd HH:mm:ss')}">2020-03-31 08:30:00</span>
            </span>
                <div class="countDown">
                <span class="kbdjs">
                    开标倒计时：
                    <span id="time"></span>
                </span>
                </div>
            </div>

            <div class="div3 fl">
                <div>
                    <span>招标开始时间：
                        <span th:text="${#dates.format(zbInfo.projectStartTime,'yyyy-MM-dd HH:mm:ss')}">2020-03-31 08:30:00</span>
                    </span>
                    <br>
                    <br>
                    <span>招标报名截至：
                        <span th:text="${#dates.format(zbInfo.projectEndTime,'yyyy-MM-dd HH:mm:ss')}">2020-03-31 08:30:00</span>
                    </span>
                </div>
            </div>

            <div class="div3 fl">
                <div>
                    <span>标书投递截至：
                        <span th:text="${#dates.format(zbInfo.filePutEndTime,'yyyy-MM-dd HH:mm:ss')}">2020-03-31 08:30:00</span>
                    </span>
                    <br>
                    <br>
                    <span>答疑截止时间：
                        <span th:text="${#dates.format(zbInfo.answerEndTime,'yyyy-MM-dd HH:mm:ss')}">2020-03-31 08:30:00</span>
                    </span>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-row layui-col-space10 margin10">
        <div class="layui-col-lg2">
            <a href="#" class="announcement">招标项目公告</a>
            <div>&nbsp</div>
            <a th:href="@{'/tb/fileUploadJump/'+${zbInfo.id}}" class="upLoadTbFile" th:if="${tbInfo?.qualFlag == 1}">上传投标文件</a>
        </div>

        <div class="layui-col-lg10">
            <div class="title">
                <br>
                <h1 th:text="${zbInfo.title}">招标项目名称</h1>
                <br>
                <h3 th:text="${zbInfo.companyName}"></h3>
            </div>
            <div class="content">

                <div class="easyeditor-panel detail-box">
                    <h2>1.项目概况与招标范围</h2>
                    <div class="easyeditor-content" th:text="${zbInfo.content}">
                    </div>
                </div>

                <div class="easyeditor-panel detail-box">
                    <h2>2.投标人资格要求</h2>
                    <div class="easyeditor-content" th:text="${zbInfo.tbRequired}">
                    </div>
                </div>

                <div class="easyeditor-panel detail-box">
                    <h2>3.招标文件的获取</h2>
                    <div class="easyeditor-content" th:text="${zbInfo.zbFileGet}">
                    </div>
                </div>

                <div class="easyeditor-panel detail-box">
                    <h2>4.投标文件的递交</h2>
                    <div class="easyeditor-content" th:text="${zbInfo.tbFilePut}"></div>
                </div>
                <div class="easyeditor-panel detail-box">
                    <h2>5.联系方式</h2>
                    <div class="easyeditor-content" th:text="${zbInfo.contact}"></div>
                </div>
                <div class="easyeditor-panel detail-box foot" th:if="${session.user !=null && session.user.status == 1}">
                    <div class="baoming" id="baoming"><a th:href="@{'/tb/apply/'+${zbInfo.id}}">我要报名</a></div>
                    <div class="baoming"><a href="/">返回首页</a></div>
                </div>

            </div>

        </div>
    </div>

</div>
</body>
<script>
    layui.config({base: '/js/mods/'}).extend({
        easyeditor: 'easyeditor'
    });

    layui.use(['element', 'util', 'easyeditor', 'jquery'], function () {
        var element = layui.element,
            util = layui.util,
            $ = layui.jquery,
            easyeditor = layui.easyeditor;

        easyeditor.render({
            elem: ".easyeditor-content" //存放md内容的元素ID
        });
        //示例
        var endTime = new Date($('#openTime').val()).getTime()//结束日期
            , serverTime = new Date().getTime(); //假设为当前服务器时间，这里采用的是本地时间，实际使用一般是取服务端的


        if (endTime <= serverTime) {
            $('#kbTag').text("已开标")
            $('#baoming').remove()
        }

        util.countdown(endTime, serverTime, function (date, serverTime, timer) {
            var str = date[0] + '天' + date[1] + '时' + date[2] + '分' + date[3] + '秒';
            layui.$('#time').html(str);
        });

    });
</script>
</div>
</body>
</html>